package cn.elricyu.tt.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * @author elricyu
 *
 */
public class URLEncodeUtil {
	
	public static String encode(String str) {
		return encode(str,"UTF-8");
	}

	public static String encode(String str, String encode) {
		try {
			return URLEncoder.encode(str,encode);
		} catch (UnsupportedEncodingException e) {
			return str;
		}
	}

}
